package com.cnap.db.entity;

import com.cnap.model.intelligent.IntelligentClusterInfo;
import com.cnap.model.intelligent.IntelligentHistoryVO;
import com.cnap.model.intelligent.IntelligentResultEnum;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 智能调度历史数据库模型类
 *
 * @author xc
 **/
public class IntelligentHistoryPO {
    private String id;
    private String serviceId;
    private List<IntelligentClusterInfo> currentClusters;
    private List<IntelligentClusterInfo> suggestClusters;
    private LocalDateTime activeTime;
    private LocalDateTime createTime;
    // 结果，0：无需优化，1：待优化，2：已优化
    private int status;

    /**
     * get
     *
     * @return Status
     */
    public int getStatus() {
        return status;
    }

    /**
     * set
     *
     * @param status status
     */
    public void setStatus(int status) {
        this.status = status;
    }

    /**
     * get
     *
     * @return Id
     */
    public String getId() {
        return id;
    }

    /**
     * set
     *
     * @param id id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * get
     *
     * @return ServiceId
     */
    public String getServiceId() {
        return serviceId;
    }

    /**
     * set
     *
     * @param serviceId serviceId
     */
    public void setServiceId(String serviceId) {
        this.serviceId = serviceId;
    }

    /**
     * get
     *
     * @return CurrentClusters
     */
    public List<IntelligentClusterInfo> getCurrentClusters() {
        return currentClusters;
    }

    /**
     * set
     *
     * @param currentClusters currentClusters
     */
    public void setCurrentClusters(List<IntelligentClusterInfo> currentClusters) {
        this.currentClusters = currentClusters;
    }

    /**
     * get
     *
     * @return SuggestClusters
     */
    public List<IntelligentClusterInfo> getSuggestClusters() {
        return suggestClusters;
    }

    /**
     * set
     *
     * @param suggestClusters suggestClusters
     */
    public void setSuggestClusters(List<IntelligentClusterInfo> suggestClusters) {
        this.suggestClusters = suggestClusters;
    }

    /**
     * get
     *
     * @return ActiveTime
     */
    public LocalDateTime getActiveTime() {
        return activeTime;
    }

    /**
     * set
     *
     * @param activeTime activeTime
     */
    public void setActiveTime(LocalDateTime activeTime) {
        this.activeTime = activeTime;
    }

    /**
     * get
     *
     * @return CreateTime
     */
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    /**
     * set
     *
     * @param createTime createTime
     */
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    /**
     * 转换成vo
     *
     * @return vo
     */
    public IntelligentHistoryVO toVO() {
        IntelligentHistoryVO vo = new IntelligentHistoryVO();
        vo.setId(this.id);
        vo.setSvcId(this.serviceId);
        vo.setCreateTime(this.createTime);
        vo.setActiveTime(this.activeTime);
        vo.setCurrentClusters(this.currentClusters);
        vo.setSuggestClusters(this.suggestClusters);
        vo.setStatus(IntelligentResultEnum.msgByStatus(this.status));
        return vo;
    }
}
